namespace Agro.Models {
        using System;
        using SN.Data;
        
        
        /// <summary>
        /// 表名：bx_Posts 主键列：PostID
        /// </summary>
        [SerializableAttribute()]
        public partial class bx_Posts : Entity {
            
            protected Int32 _PostID;
            
            protected Int32? _ParentID;
            
            protected Int32 _ForumID;
            
            protected Int32 _ThreadID;
            
            protected Byte _PostType;
            
            protected Int32 _IconID;
            
            protected String _Subject;
            
            protected String _Content;
            
            protected Byte _ContentFormat;
            
            protected Boolean _EnableSignature;
            
            protected Boolean _EnableReplyNotice;
            
            protected Boolean _IsShielded;
            
            protected Int32 _UserID;
            
            protected String _NickName;
            
            protected Int32 _LastEditorID;
            
            protected String _LastEditor;
            
            protected String _IPAddress;
            
            protected DateTime _CreateDate;
            
            protected DateTime _UpdateDate;
            
            protected Int32? _MarkCount;
            
            protected Int32? _LoveCount;
            
            protected Int32? _HateCount;
            
            protected Int64 _SortOrder;
            
            protected Int32? _FloorNumber;
            
            protected String _KeywordVersion;
            
            protected String _HistoryAttachmentIDs;

            protected String _CodeName;
            
            public Int32 PostID {
                get {
                    return this._PostID;
                }
                set {
                    this.OnPropertyValueChange(_.PostID, _PostID, value);
                    this._PostID = value;
                }
            }
            
            public Int32? ParentID {
                get {
                    return this._ParentID;
                }
                set {
                    this.OnPropertyValueChange(_.ParentID, _ParentID, value);
                    this._ParentID = value;
                }
            }
            
            public Int32 ForumID {
                get {
                    return this._ForumID;
                }
                set {
                    this.OnPropertyValueChange(_.ForumID, _ForumID, value);
                    this._ForumID = value;
                }
            }
            
            public Int32 ThreadID {
                get {
                    return this._ThreadID;
                }
                set {
                    this.OnPropertyValueChange(_.ThreadID, _ThreadID, value);
                    this._ThreadID = value;
                }
            }
            
            public Byte PostType {
                get {
                    return this._PostType;
                }
                set {
                    this.OnPropertyValueChange(_.PostType, _PostType, value);
                    this._PostType = value;
                }
            }
            
            public Int32 IconID {
                get {
                    return this._IconID;
                }
                set {
                    this.OnPropertyValueChange(_.IconID, _IconID, value);
                    this._IconID = value;
                }
            }
            
            public String Subject {
                get {
                    return this._Subject;
                }
                set {
                    this.OnPropertyValueChange(_.Subject, _Subject, value);
                    this._Subject = value;
                }
            }
            
            public String Content {
                get {
                    return this._Content;
                }
                set {
                    this.OnPropertyValueChange(_.Content, _Content, value);
                    this._Content = value;
                }
            }
            
            public Byte ContentFormat {
                get {
                    return this._ContentFormat;
                }
                set {
                    this.OnPropertyValueChange(_.ContentFormat, _ContentFormat, value);
                    this._ContentFormat = value;
                }
            }
            
            public Boolean EnableSignature {
                get {
                    return this._EnableSignature;
                }
                set {
                    this.OnPropertyValueChange(_.EnableSignature, _EnableSignature, value);
                    this._EnableSignature = value;
                }
            }
            
            public Boolean EnableReplyNotice {
                get {
                    return this._EnableReplyNotice;
                }
                set {
                    this.OnPropertyValueChange(_.EnableReplyNotice, _EnableReplyNotice, value);
                    this._EnableReplyNotice = value;
                }
            }
            
            public Boolean IsShielded {
                get {
                    return this._IsShielded;
                }
                set {
                    this.OnPropertyValueChange(_.IsShielded, _IsShielded, value);
                    this._IsShielded = value;
                }
            }
            
            public Int32 UserID {
                get {
                    return this._UserID;
                }
                set {
                    this.OnPropertyValueChange(_.UserID, _UserID, value);
                    this._UserID = value;
                }
            }
            
            public String NickName {
                get {
                    return this._NickName;
                }
                set {
                    this.OnPropertyValueChange(_.NickName, _NickName, value);
                    this._NickName = value;
                }
            }
            
            public Int32 LastEditorID {
                get {
                    return this._LastEditorID;
                }
                set {
                    this.OnPropertyValueChange(_.LastEditorID, _LastEditorID, value);
                    this._LastEditorID = value;
                }
            }
            
            public String LastEditor {
                get {
                    return this._LastEditor;
                }
                set {
                    this.OnPropertyValueChange(_.LastEditor, _LastEditor, value);
                    this._LastEditor = value;
                }
            }
            
            public String IPAddress {
                get {
                    return this._IPAddress;
                }
                set {
                    this.OnPropertyValueChange(_.IPAddress, _IPAddress, value);
                    this._IPAddress = value;
                }
            }
            
            public DateTime CreateDate {
                get {
                    return this._CreateDate;
                }
                set {
                    this.OnPropertyValueChange(_.CreateDate, _CreateDate, value);
                    this._CreateDate = value;
                }
            }
            
            public DateTime UpdateDate {
                get {
                    return this._UpdateDate;
                }
                set {
                    this.OnPropertyValueChange(_.UpdateDate, _UpdateDate, value);
                    this._UpdateDate = value;
                }
            }
            
            public Int32? MarkCount {
                get {
                    return this._MarkCount;
                }
                set {
                    this.OnPropertyValueChange(_.MarkCount, _MarkCount, value);
                    this._MarkCount = value;
                }
            }
            
            public Int32? LoveCount {
                get {
                    return this._LoveCount;
                }
                set {
                    this.OnPropertyValueChange(_.LoveCount, _LoveCount, value);
                    this._LoveCount = value;
                }
            }
            
            public Int32? HateCount {
                get {
                    return this._HateCount;
                }
                set {
                    this.OnPropertyValueChange(_.HateCount, _HateCount, value);
                    this._HateCount = value;
                }
            }
            
            public Int64 SortOrder {
                get {
                    return this._SortOrder;
                }
                set {
                    this.OnPropertyValueChange(_.SortOrder, _SortOrder, value);
                    this._SortOrder = value;
                }
            }
            
            public Int32? FloorNumber {
                get {
                    return this._FloorNumber;
                }
                set {
                    this.OnPropertyValueChange(_.FloorNumber, _FloorNumber, value);
                    this._FloorNumber = value;
                }
            }
            
            public String KeywordVersion {
                get {
                    return this._KeywordVersion;
                }
                set {
                    this.OnPropertyValueChange(_.KeywordVersion, _KeywordVersion, value);
                    this._KeywordVersion = value;
                }
            }
            
            public String HistoryAttachmentIDs {
                get {
                    return this._HistoryAttachmentIDs;
                }
                set {
                    this.OnPropertyValueChange(_.HistoryAttachmentIDs, _HistoryAttachmentIDs, value);
                    this._HistoryAttachmentIDs = value;
                }
            }

            public String CodeName
            {
                get
                {
                    return this._CodeName;
                }
                set
                {
                    this.OnPropertyValueChange(_.CodeName, CodeName, value);
                    this._HistoryAttachmentIDs = value;
                }
            }
            /// <summary>
            /// 获取实体对应的表名
            /// </summary>
            protected override Table GetTable() {
                return new Table<bx_Posts>("bx_Posts");
            }
            
            /// <summary>
            /// 获取实体中的标识列
            /// </summary>
            protected override Field GetIdentityField() {
                return _.PostID;
            }
            
            /// <summary>
            /// 获取实体中的主键列
            /// </summary>
            protected override Field[] GetPrimaryKeyFields() {
                return new Field[] {
                        _.PostID};
            }
            
            /// <summary>
            /// 获取列信息
            /// </summary>
            protected override Field[] GetFields() {
                return new Field[] {
                        _.PostID,
                        _.ParentID,
                        _.ForumID,
                        _.ThreadID,
                        _.PostType,
                        _.IconID,
                        _.Subject,
                        _.Content,
                        _.ContentFormat,
                        _.EnableSignature,
                        _.EnableReplyNotice,
                        _.IsShielded,
                        _.UserID,
                        _.NickName,
                        _.LastEditorID,
                        _.LastEditor,
                        _.IPAddress,
                        _.CreateDate,
                        _.UpdateDate,
                        _.MarkCount,
                        _.LoveCount,
                        _.HateCount,
                        _.SortOrder,
                        _.FloorNumber,
                        _.KeywordVersion,
                        _.HistoryAttachmentIDs,
                _.CodeName};
            }
            
            /// <summary>
            /// 获取列数据
            /// </summary>
            protected override object[] GetValues() {
                return new object[] {
                        this._PostID,
                        this._ParentID,
                        this._ForumID,
                        this._ThreadID,
                        this._PostType,
                        this._IconID,
                        this._Subject,
                        this._Content,
                        this._ContentFormat,
                        this._EnableSignature,
                        this._EnableReplyNotice,
                        this._IsShielded,
                        this._UserID,
                        this._NickName,
                        this._LastEditorID,
                        this._LastEditor,
                        this._IPAddress,
                        this._CreateDate,
                        this._UpdateDate,
                        this._MarkCount,
                        this._LoveCount,
                        this._HateCount,
                        this._SortOrder,
                        this._FloorNumber,
                        this._KeywordVersion,
                        this._HistoryAttachmentIDs,
                this._CodeName};
            }
            
            /// <summary>
            /// 给当前实体赋值
            /// </summary>
            protected override void SetValues(IRowReader reader) {
                if ((false == reader.IsDBNull(_.PostID))) {
                    this._PostID = reader.GetInt32(_.PostID);
                }
                if ((false == reader.IsDBNull(_.ParentID))) {
                    this._ParentID = reader.GetInt32(_.ParentID);
                }
                if ((false == reader.IsDBNull(_.ForumID))) {
                    this._ForumID = reader.GetInt32(_.ForumID);
                }
                if ((false == reader.IsDBNull(_.ThreadID))) {
                    this._ThreadID = reader.GetInt32(_.ThreadID);
                }
                if ((false == reader.IsDBNull(_.PostType))) {
                    this._PostType = reader.GetByte(_.PostType);
                }
                if ((false == reader.IsDBNull(_.IconID))) {
                    this._IconID = reader.GetInt32(_.IconID);
                }
                if ((false == reader.IsDBNull(_.Subject))) {
                    this._Subject = reader.GetString(_.Subject);
                }
                if ((false == reader.IsDBNull(_.Content))) {
                    this._Content = reader.GetString(_.Content);
                }
                if ((false == reader.IsDBNull(_.ContentFormat))) {
                    this._ContentFormat = reader.GetByte(_.ContentFormat);
                }
                if ((false == reader.IsDBNull(_.EnableSignature))) {
                    this._EnableSignature = reader.GetBoolean(_.EnableSignature);
                }
                if ((false == reader.IsDBNull(_.EnableReplyNotice))) {
                    this._EnableReplyNotice = reader.GetBoolean(_.EnableReplyNotice);
                }
                if ((false == reader.IsDBNull(_.IsShielded))) {
                    this._IsShielded = reader.GetBoolean(_.IsShielded);
                }
                if ((false == reader.IsDBNull(_.UserID))) {
                    this._UserID = reader.GetInt32(_.UserID);
                }
                if ((false == reader.IsDBNull(_.NickName))) {
                    this._NickName = reader.GetString(_.NickName);
                }
                if ((false == reader.IsDBNull(_.LastEditorID))) {
                    this._LastEditorID = reader.GetInt32(_.LastEditorID);
                }
                if ((false == reader.IsDBNull(_.LastEditor))) {
                    this._LastEditor = reader.GetString(_.LastEditor);
                }
                if ((false == reader.IsDBNull(_.IPAddress))) {
                    this._IPAddress = reader.GetString(_.IPAddress);
                }
                if ((false == reader.IsDBNull(_.CreateDate))) {
                    this._CreateDate = reader.GetDateTime(_.CreateDate);
                }
                if ((false == reader.IsDBNull(_.UpdateDate))) {
                    this._UpdateDate = reader.GetDateTime(_.UpdateDate);
                }
                if ((false == reader.IsDBNull(_.MarkCount))) {
                    this._MarkCount = reader.GetInt32(_.MarkCount);
                }
                if ((false == reader.IsDBNull(_.LoveCount))) {
                    this._LoveCount = reader.GetInt32(_.LoveCount);
                }
                if ((false == reader.IsDBNull(_.HateCount))) {
                    this._HateCount = reader.GetInt32(_.HateCount);
                }
                if ((false == reader.IsDBNull(_.SortOrder))) {
                    this._SortOrder = reader.GetInt64(_.SortOrder);
                }
                if ((false == reader.IsDBNull(_.FloorNumber))) {
                    this._FloorNumber = reader.GetInt32(_.FloorNumber);
                }
                if ((false == reader.IsDBNull(_.KeywordVersion))) {
                    this._KeywordVersion = reader.GetString(_.KeywordVersion);
                }
                if ((false == reader.IsDBNull(_.HistoryAttachmentIDs))) {
                    this._HistoryAttachmentIDs = reader.GetString(_.HistoryAttachmentIDs);
                }
                if ((false == reader.IsDBNull(_.CodeName)))
                {
                    this._CodeName = reader.GetString(_.CodeName);
                }
            }
            
            public override int GetHashCode() {
                return base.GetHashCode();
            }
            
            public override bool Equals(object obj) {
                if ((obj == null)) {
                    return false;
                }
                if ((false == typeof(bx_Posts).IsAssignableFrom(obj.GetType()))) {
                    return false;
                }
                if ((((object)(this)) == ((object)(obj)))) {
                    return true;
                }
                return false;
            }
            
            public class _ {
                
                /// <summary>
                /// 表示选择所有列，与*等同
                /// </summary>
                public static AllField All = new AllField<bx_Posts>();
                
                /// <summary>
                /// 字段名：PostID - 数据类型：Int32
                /// </summary>
                public static Field PostID = new Field<bx_Posts>("PostID");
                
                /// <summary>
                /// 字段名：ParentID - 数据类型：Nullable`1
                /// </summary>
                public static Field ParentID = new Field<bx_Posts>("ParentID");
                
                /// <summary>
                /// 字段名：ForumID - 数据类型：Int32
                /// </summary>
                public static Field ForumID = new Field<bx_Posts>("ForumID");
                
                /// <summary>
                /// 字段名：ThreadID - 数据类型：Int32
                /// </summary>
                public static Field ThreadID = new Field<bx_Posts>("ThreadID");
                
                /// <summary>
                /// 字段名：PostType - 数据类型：Byte
                /// </summary>
                public static Field PostType = new Field<bx_Posts>("PostType");
                
                /// <summary>
                /// 字段名：IconID - 数据类型：Int32
                /// </summary>
                public static Field IconID = new Field<bx_Posts>("IconID");
                
                /// <summary>
                /// 字段名：Subject - 数据类型：String
                /// </summary>
                public static Field Subject = new Field<bx_Posts>("Subject");
                
                /// <summary>
                /// 字段名：Content - 数据类型：String
                /// </summary>
                public static Field Content = new Field<bx_Posts>("Content");
                
                /// <summary>
                /// 字段名：ContentFormat - 数据类型：Byte
                /// </summary>
                public static Field ContentFormat = new Field<bx_Posts>("ContentFormat");
                
                /// <summary>
                /// 字段名：EnableSignature - 数据类型：Boolean
                /// </summary>
                public static Field EnableSignature = new Field<bx_Posts>("EnableSignature");
                
                /// <summary>
                /// 字段名：EnableReplyNotice - 数据类型：Boolean
                /// </summary>
                public static Field EnableReplyNotice = new Field<bx_Posts>("EnableReplyNotice");
                
                /// <summary>
                /// 字段名：IsShielded - 数据类型：Boolean
                /// </summary>
                public static Field IsShielded = new Field<bx_Posts>("IsShielded");
                
                /// <summary>
                /// 字段名：UserID - 数据类型：Int32
                /// </summary>
                public static Field UserID = new Field<bx_Posts>("UserID");
                
                /// <summary>
                /// 字段名：NickName - 数据类型：String
                /// </summary>
                public static Field NickName = new Field<bx_Posts>("NickName");
                
                /// <summary>
                /// 字段名：LastEditorID - 数据类型：Int32
                /// </summary>
                public static Field LastEditorID = new Field<bx_Posts>("LastEditorID");
                
                /// <summary>
                /// 字段名：LastEditor - 数据类型：String
                /// </summary>
                public static Field LastEditor = new Field<bx_Posts>("LastEditor");
                
                /// <summary>
                /// 字段名：IPAddress - 数据类型：String
                /// </summary>
                public static Field IPAddress = new Field<bx_Posts>("IPAddress");
                
                /// <summary>
                /// 字段名：CreateDate - 数据类型：DateTime
                /// </summary>
                public static Field CreateDate = new Field<bx_Posts>("CreateDate");
                
                /// <summary>
                /// 字段名：UpdateDate - 数据类型：DateTime
                /// </summary>
                public static Field UpdateDate = new Field<bx_Posts>("UpdateDate");
                
                /// <summary>
                /// 字段名：MarkCount - 数据类型：Nullable`1
                /// </summary>
                public static Field MarkCount = new Field<bx_Posts>("MarkCount");
                
                /// <summary>
                /// 字段名：LoveCount - 数据类型：Nullable`1
                /// </summary>
                public static Field LoveCount = new Field<bx_Posts>("LoveCount");
                
                /// <summary>
                /// 字段名：HateCount - 数据类型：Nullable`1
                /// </summary>
                public static Field HateCount = new Field<bx_Posts>("HateCount");
                
                /// <summary>
                /// 字段名：SortOrder - 数据类型：Int64
                /// </summary>
                public static Field SortOrder = new Field<bx_Posts>("SortOrder");
                
                /// <summary>
                /// 字段名：FloorNumber - 数据类型：Nullable`1
                /// </summary>
                public static Field FloorNumber = new Field<bx_Posts>("FloorNumber");
                
                /// <summary>
                /// 字段名：KeywordVersion - 数据类型：String
                /// </summary>
                public static Field KeywordVersion = new Field<bx_Posts>("KeywordVersion");
                
                /// <summary>
                /// 字段名：HistoryAttachmentIDs - 数据类型：String
                /// </summary>
                public static Field HistoryAttachmentIDs = new Field<bx_Posts>("HistoryAttachmentIDs");
                /// <summary>
                /// 字段名：HistoryAttachmentIDs - 数据类型：String
                /// </summary>
                public static Field CodeName = new Field<bx_Posts>("CodeName");
            }
        }
    }
